package com.gengzp.common.model.task.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @ClassName CreateScheduledTaskReq
 * @Description 创建定时任务请求实体
 * @Author gengzp
 * @Date 2025/9/30 11:20
 */
@Data
@ApiModel("创建定时任务请求实体")
public class CreateScheduledTaskReq implements Serializable {

    @Serial
    private static final long serialVersionUID = -6041483906000353301L;

    /**
     * 任务名
     */
    @NotBlank(message = "任务名不能为空")
    @ApiModelProperty(value = "任务名", required = true, example = "数据同步任务")
    private String taskName;

    /**
     * 任务描述
     */
    @NotBlank(message = "任务描述不能为空")
    @ApiModelProperty(value = "任务描述", example = "每日凌晨同步用户数据")
    private String taskDescription;

    /**
     * 服务名
     */
    @NotBlank(message = "服务名不能为空")
    @ApiModelProperty(value = "服务名", required = true, example = "user-service")
    private String serviceName;

    /**
     * 任务调用接口资源标识
     */
    @NotBlank(message = "任务调用接口资源标识不能为空")
    @ApiModelProperty(value = "接口资源标识", required = true, example = "/api/v1/user/sync")
    private String uri;

    /**
     * cron表达式
     */
    @NotBlank(message = "cron表达式不能为空")
    @ApiModelProperty(value = "cron表达式", required = true, example = "0 0 1 * * ?")
    private String cronExpression;

}
